diff options
author | Fushihara <1039534+fushihara@users.noreply.github.com> | 2024-09-25 09:19:13 +0900 |
---|---|---|
committer | Fushihara <1039534+fushihara@users.noreply.github.com> | 2024-09-25 09:19:13 +0900 |
commit | 4ccee1438e3c341075fdcf1d62e6900eb29d1908 (patch) | |
tree | 852dd4e1b74f6d45371619d1c55d3f94343c5c38 /src/app/article/all/[pageId]/page.tsx | |
parent | 2ce86e17bdeaaa00d758ecb312f2171c33d7d5ec (diff) |
データ読み込みのクラスをシングルトン化
Diffstat (limited to 'src/app/article/all/[pageId]/page.tsx')
-rw-r--r-- | src/app/article/all/[pageId]/page.tsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/app/article/all/[pageId]/page.tsx b/src/app/article/all/[pageId]/page.tsx index 0374401..fda6fbb 100644 --- a/src/app/article/all/[pageId]/page.tsx +++ b/src/app/article/all/[pageId]/page.tsx @@ -21,8 +21,7 @@ export async function generateMetadata(context: PageType) { } export default async function Page(context: PageType) { const pageId = getPageIdNumber(context.params.pageId); - const al = new ArticleLoader() - const loadedData = await al.loadData(); + const loadedData = await ArticleLoader.instance.loadData(); const chunkdData = chunk(loadedData, PPV); const displayData = chunkdData[pageId - 1]; return ( @@ -142,8 +141,7 @@ if (!Number.isInteger(PPV)) { } //export const dynamicParams = true; export async function generateStaticParams() { - const al = new ArticleLoader() - const loadedData = await al.loadData(); + const loadedData = await ArticleLoader.instance.loadData(); const chunkdData = chunk(loadedData, PPV); return chunkdData.map((data, index) => { return { pageId: `page-${index + 1}`, data: data }; |